package top.bbman.boot.exception.global;

import lombok.Data;
import lombok.EqualsAndHashCode;
import top.bbman.boot.repository.base.PeaErrorCode;

/**
 * 自定义异常
 *
 * @author 祥霸
 * @version 1.0.0
 */
@EqualsAndHashCode(callSuper = true)
@Data
public class PeaBizException extends RuntimeException {
    private Integer code;

    private String message;

    public PeaBizException(PeaErrorCode errorCode) {
        super(errorCode.code() + ":" + errorCode.msg());
        this.code = errorCode.code();
        this.message = errorCode.msg();
    }
}
